#ifndef __CLAMP_H__
#define __CLAMP_H__

#include "sceneObject.h"
#include "clampSide.h"
#include "../actions/grabber.h"

class Clamp : public SceneObject, public Grabber{
	private:
		static Vertexf vertices[];
		static const unsigned int nVertices = 4;

		typedef enum{ OPEN,CLOSING,OPENING,CLOSED } State;
		State state;
		static const float maxRotationAngle;
		static const float rotationSpeed;

	public:
		Clamp(Rectangle rec);
		~Clamp();

		virtual void draw();
		virtual void timeStep();

		void open();
		void close();

		void addObject(const std::string& name,SceneObject* obj);

		void move(float dx,float dy);

		bool isOpen();
		bool isClosed();

		static std::string name(){
			return "clamp";
		}
};

#endif /* __CLAMP_SIDE_H__ */

